package JTest;

import Messages.Exceptions.MessageCreationException;
import Messages.Exceptions.MessageLengthException;
import Model.Exceptions.FileIdException;
import Model.Exceptions.PathFileException;
import Model.FileId;
import Model.PathFile;
import Model.Status;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.Socket;
import java.util.ArrayList;
import messages.MessagesFactory;



public class TestEmissionSignaux {

	/**
	 * @param args
	 * @throws UniformedUsername 
	 * @throws UniformedMessage 
	 * @throws UniformedPathFile 
	 * @throws IOException 
	 */
//	 public static void main(String[] args) throws MessageCreationException, MessageLengthException, FileIdException, PathFileException, IOException  {
//		// TODO Auto-generated method stub
//                String localUser="Franck";
//                int PORT_CLIENT=50000;
//                int PORT_SERVER=55000;
//                
//		ArrayList<byte[]> signaux = new ArrayList<byte[]>() ;
//		signaux.add(MessagesFactory.getHello(localUser, true));
//		signaux.add(MessagesFactory.getBye(localUser));
//                signaux.add(MessagesFactory.getChatMessage(localUser, "Ceci est un test"));
//                signaux.add(MessagesFactory.getComposing(localUser, true));
//                signaux.add(MessagesFactory.getPresence(localUser, Status.CHAT));
//                signaux.add(MessagesFactory.getWizz(localUser));
//                FileId fileid=new FileId();
//                signaux.add(MessagesFactory.getFileRequest(localUser, new PathFile("/home/franck/test.pdf"), fileid, 5000));
//		signaux.add(MessagesFactory.getFileResponse(localUser, false, 49500, fileid));
//                		
//		InetAddress address_server = new InetSocketAddress("127.0.0.1", 0).getAddress();
//		
//                DatagramSocket client = new DatagramSocket(PORT_CLIENT,InetAddress.getLocalHost());
//		DatagramPacket packet;
//
//		while(true) {
//                        for(byte[] messageByte : signaux){
//                             packet=new DatagramPacket(messageByte, messageByte.length,address_server, PORT_SERVER);
//                             client.send(packet);
//                        }
//		}
//	 }

}
